import xadmin
from apps.organizations.models import Teacher, CourseOrg, City


class OrganizationAdmin(object):
    list_display = ['id', 'name', 'city', 'tag', 'category', 'fav_nums', 'course_nums']
    list_filter = ['category', 'city']
    search_fields = ['name', 'desc', 'tag']
    list_per_page = 15


class TeacherAdmin(object):
    list_display = ['id', 'name', 'org', 'age', 'work_years', 'work_compy', 'work_position', 'points', 'fav_nums']
    list_filter = ['org', 'age']
    search_fields = ['name']
    list_per_page = 15


class CityAdmin(object):
    list_display = ['id', 'name', 'dec']
    search_fields = ['name', 'desc']
    list_per_page = 15


xadmin.site.register(Teacher, TeacherAdmin)
xadmin.site.register(CourseOrg, OrganizationAdmin)
xadmin.site.register(City, CityAdmin)

from xadmin import views


class GlobalSetting(object):
    site_title = '幕学网'
    site_footer = 'xxx科技公司'


xadmin.site.register(views.CommAdminView, GlobalSetting)
